<?php


namespace app\api\model;


class CouponQrcode extends BaseModel
{

    protected $autoWriteTimestamp = true;

    /**
     * 创建二维码
     * @param $data
     * @return CouponQrcode
     */
    public static function createQrcode($data){
        return self::create($data);
    }

    /**
     * 查询优惠卷二维码
     * @param $wu_id
     * @param $c_id
     * @return array|false|\PDOStatement|string|\think\Model
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public static function getUrl($wu_id,$c_id){
        return self::where('wu_id','=',$wu_id)
                ->where('c_id','=',$c_id)
                ->find();
    }

}